test(analyzer): α — 18-query parity catalog for analyzer unification - #188
Merged
Merged
Conversation
…engine analyzers PR α of the analyzer-unification chain (α→β→γ→δ→ε). Pure additive baseline that freezes what each PromQL → asap-tier analyzer answers today, so β/γ have a verifiable parity contract before they start collapsing the two surfaces. Rebased onto origin/main (post-PR #211): doc moved to control_plane/docs/ and the controller→control_plane / warm_tier→ asap_tier renames swept through. Golden master re-verified byte-for-byte against the new base. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol
force-pushed
the
feat/analyzer-parity-alpha
branch
from
May 14, 2026 14:35
1e39d86 to
321982d
Compare
3 tasks
zzylol
added a commit
that referenced
this pull request
May 14, 2026
…gg routing change (#236) PR #232 changed `control_plane::asap_tier_analysis`: `rate` / `irate` / `increase` / `sum` and bare selectors now lower to `AggIntent::Sum`, which `capability_for` maps to `Capability::ExactAgg(Sum)` — so they are ASAP-tier-answerable from exact-precompute state instead of being archive-routed. `data_plane` consumes that analyzer, and two of its tests pinned the old behaviour: * `analyzer_parity_18_query_corpus` — the 18-query golden master (PR #188). The `ctrl` rows for q04–q07, q12–q17 (and the q08 label `count_over_time` → `count`) shifted to `OK [... ExactAgg(Sum) ...]` / candidate rows. `GOLDEN` regenerated from the new actual; the `engine` rows — the actual parity contract — are unchanged. * `execute_rejects_bare_selector_via_analyzer` → renamed `execute_bare_selector_falls_over_to_archive`. A bare selector is no longer rejected with `NoCallNodeFound`; it binds to an `ExactAgg(Sum)` candidate that finds no matching policy in the test's DDSketch-only `SketchStore`, so it still `CapabilityMiss`es to the archive engine — same routing outcome, different detail. No behaviour change here — `data_plane`'s test expectations catching up to the intentional #232 analyzer change. 768 lib tests pass. Pre-existing unrelated failure: `kll_envelope_round_trip_through_backend_adapter` (KLL sketch byte serialization) fails on clean `main` too — untouched by this change. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR α of the analyzer-unification chain (α→β→γ→δ→ε). Pure additive
baseline that freezes what each PromQL → warm-tier analyzer answers
today, so β/γ have a verifiable parity contract before they start
collapsing the two surfaces.
analyzer_parity_testsinline#[cfg(test)] modindata_plane/src/query_engines/asap_query_engine/engine.rs: 18-querycorpus covering
quantile_over_time,sum-by,topk,count_over_time,histogram_quantile, bare selectors,rate/irate/increase,sum(rate(...)), and unparseable input.Single
assert_eq!against an embedded golden-master captured onorigin/main@6557fb8.controller/docs/analyzer-parity-matrix.md(168 lines): humancatalog of the same 18 rows. Documents the 5 controller-rejects-but-
engine-accepts divergences the chain is meant to resolve — D1
sum_by(m), D2topk(k, m), D3count_over_time(m[r]),D4
rate/increase, D5sum(rate(m[r]))— plus β/γ/δ/εamendment rules and pointers to both pipelines' source files.
Findings worth flagging (caught by the corpus)
irate" is outdated:irateis not in the engine's pattern list — both analyzers reject it
(parity).
histogram_quantileparser substitution onlyhandles
histogram_quantile(phi, MatrixSelector); the composedPrometheus-canonical
histogram_quantile(phi, sum_by(le, rate(m[r])))is rejected with
UnparseableMetricsql("expected MatrixSelector, got Discriminant(...)"). Worth a re-examination when ε expandsthe corpus.
Capability::QuantileApprox(Any), notQuantileApprox(DDSketch)as the TODO doc references. Family-wildcard form; downstream
is_satisfied_bydoes the family match.Scope / risk
engine.rs, 168 LOC new doc. Zero productioncode edits, zero visibility changes, zero new deps.
parse_and_match_promqlandbuild_query_requirements_promqlstayprivate — the test lives in the same module and reaches them via
super::*.origin/main@6557fb8so it rebases cleanly ontothe in-flight
feat/schema-retire-final-*slices.Test plan
cargo build -p data_plane --libclean (6 pre-existing warnings)cargo test -p data_plane --lib analyzer_parity_tests→ 1 passedcargo test -p controller --lib warm_tier_analysis→ 19 passed (unaffected)controller/docs/analyzer-parity-matrix.mdalongside the golden in
engine.rsand confirm each row'sD{1..5}annotation matches your expectations before β starts.want γ to preserve. Anything to add now (cheap) vs in ε
(expensive — diff churn against the embedded golden)?
🤖 Generated with Claude Code